<%@ page import="java.net.URLDecoder" %><%--
  Created by IntelliJ IDEA.
  User: liu
  Date: 2017/9/22
  Time: 9:40
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    Cookie cookie = null;
    Cookie[] cookies = null;
    // 获取当前域名下的cookies，是一个数组
    cookies = request.getCookies();
    if( cookies != null ){
        for (int i = 0; i < cookies.length; i++){
            cookie = cookies[i];
            if((cookie.getName( )).compareTo("username") == 0 ){
                cookie.setMaxAge(0);
                response.addCookie(cookie);
                System.out.println("删除"+cookie.getName());

            }
            if((cookie.getName( )).compareTo("type") == 0 ){
                cookie.setMaxAge(0);
                response.addCookie(cookie);
                System.out.println("删除"+cookie.getName());
            }
        }
    }
    session.setAttribute("name",null);
    session.setAttribute("type",null);
    request.setAttribute("msg","退出成功，请重新登录");
    out.print("正在跳转");
    System.out.println("正在跳转");
    request.getRequestDispatcher("/adm/managerLogin.jsp").forward(request,response);
%>
<html>
<head>
    <title>退出登录</title>
</head>
<body>

</body>
</html>
